<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>贪吃蛇</title>
    <link rel="stylesheet" href="index.css" />
  </head>
  <body>
    <div class="playground">
      <h3 id="score">分数</h3>
      <!-- 游戏帮助 -->
      <div class="help">
        <h3>游戏帮助</h3>
        <ul>
          <li>使用 WASD 或方向键移动</li>
          <li>游戏速度与蛇的长度成正比</li>
        </ul>

        <h3>失败条件</h3>
        <ul>
          <li>触碰地图边界</li>
          <li>碰到自己</li>
        </ul>
      </div>
      <div id="game"></div>
    </div>

    <div class="start" id="start">
      <h2>贪吃蛇</h2>
      <button id="startGame">开始游戏</button>
    </div>

    <div class="over" id="over">
      <h2>游戏结束</h2>
      <p>您的分数是:<span id="final-score"></span></p>
      <button id="restart">重新开始</button>
    </div>

    <script src="./js/Game.js"></script>
    <script src="./js/Snake.js"></script>
    <script src="./js/Food.js"></script>
    <script>
      var game = new Game();
    </script>
  </body>
</html>
